package com.ruoyi.system.api.factory;

import com.ruoyi.common.core.domain.R;
import com.ruoyi.system.api.RemoteDictService;
import com.ruoyi.system.api.RemoteDimeSerialNumberService;
import com.ruoyi.system.api.RemoteFileService;
import com.ruoyi.system.api.domain.SysFile;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.cloud.openfeign.FallbackFactory;
import org.springframework.stereotype.Component;
import org.springframework.web.multipart.MultipartFile;

@Component
public class RemoteDimeSerialNumberFallbackFactory  implements FallbackFactory<RemoteDimeSerialNumberService> {
    private static final Logger log = LoggerFactory.getLogger(RemoteDimeSerialNumberFallbackFactory.class);
    @Override
    public RemoteDimeSerialNumberService create(Throwable throwable)
    {
        log.error("获取流水号失败:{}", throwable.getMessage());
        return new RemoteDimeSerialNumberService()
        {

            @Override
            public R<String> getOccupationalReportNo() {
                return R.fail("获取流水号失败:" + throwable.getMessage());
            }
        };
    }
}
